package cn.pconline.autoclub.entity;

import cn.pconline.autoclub.util.EncodeUtils;
import com.alibaba.fastjson.JSONObject;
import java.util.Date;
import org.gelivable.dao.Column;
import org.gelivable.dao.Entity;
import org.gelivable.dao.Id;

@Entity(tableName = "ac_club_draft")
public class ClubDraft {

    @Id
    @Column(name = "user_id")
	private long userId;
	private String name;
	@Column(name = "club_url")
	private String clubUrl;
	@Column(name = "province_id")
	private long provinceId;//所属省份Id
	@Column(name = "province_name")
	private String provinceName;//所属省份
	@Column(name = "city_id")
	private long cityId;//所属城市Id
	@Column(name = "city_name")
	private String cityName;//所属城市
	@Column(name = "brand_id")
	private long brandId;//品牌ID
	@Column(name = "brand_name")
	private String brandName;//品牌名称
	@Column(name = "series_id")
	private long seriesId;//车系ID
	@Column(name = "series_name")
	private String seriesName;//车系名称
	@Column(name = "theme_id")
	private long themeId;//主题id
	@Column(name = "type_id")
	private int typeId;//类型：1-地区，2-车系，3-主题
	@Column(name = "app_banner")
	private String appBanner;//app、wap车友会封面
	@Column(name = "qq_group")
	private String qqGroup; //qq群
	private String introduce;//简介
	@Column(name = "create_by")
	private long createBy;//创建者
	@Column(name = "create_at")
	private Date createAt;//创建时间
	@Column(name = "update_by")
	private long updateBy;//更新者
	@Column(name = "update_at")
	private Date updateAt;//更新时间
	public long getUserId() {
    	return userId;
    }
	public void setUserId( long userId ) {
    	this.userId = userId;
    }
	public String getName() {
    	return name;
    }
	public void setName( String name ) {
    	this.name = name;
    }
	public String getClubUrl() {
    	return clubUrl;
    }
	public void setClubUrl( String clubUrl ) {
    	this.clubUrl = clubUrl;
    }
	public long getProvinceId() {
    	return provinceId;
    }
	public void setProvinceId( long provinceId ) {
    	this.provinceId = provinceId;
    }
	public String getProvinceName() {
    	return provinceName;
    }
	public void setProvinceName( String provinceName ) {
    	this.provinceName = provinceName;
    }
	public long getCityId() {
    	return cityId;
    }
	public void setCityId( long cityId ) {
    	this.cityId = cityId;
    }
	public String getCityName() {
    	return cityName;
    }
	public void setCityName( String cityName ) {
    	this.cityName = cityName;
    }
	public long getBrandId() {
    	return brandId;
    }
	public void setBrandId( long brandId ) {
    	this.brandId = brandId;
    }
	public String getBrandName() {
    	return brandName;
    }
	public void setBrandName( String brandName ) {
    	this.brandName = brandName;
    }
	public long getSeriesId() {
    	return seriesId;
    }
	public void setSeriesId( long seriesId ) {
    	this.seriesId = seriesId;
    }
	public String getSeriesName() {
    	return seriesName;
    }
	public void setSeriesName( String seriesName ) {
    	this.seriesName = seriesName;
    }
	public long getThemeId() {
    	return themeId;
    }
	public void setThemeId( long themeId ) {
    	this.themeId = themeId;
    }
	public int getTypeId() {
    	return typeId;
    }
	public void setTypeId( int typeId ) {
    	this.typeId = typeId;
    }
	public String getAppBanner() {
    	return appBanner;
    }
	public void setAppBanner( String appBanner ) {
    	this.appBanner = appBanner;
    }
	public String getQqGroup() {
    	return qqGroup;
    }
	public void setQqGroup( String qqGroup ) {
    	this.qqGroup = qqGroup;
    }
	public String getIntroduce() {
    	return introduce;
    }
	public void setIntroduce( String introduce ) {
    	this.introduce = introduce;
    }
	public long getCreateBy() {
    	return createBy;
    }
	public void setCreateBy( long createBy ) {
    	this.createBy = createBy;
    }
	public Date getCreateAt() {
    	return createAt;
    }
	public void setCreateAt( Date createAt ) {
    	this.createAt = createAt;
    }
	public long getUpdateBy() {
    	return updateBy;
    }
	public void setUpdateBy( long updateBy ) {
    	this.updateBy = updateBy;
    }
	public Date getUpdateAt() {
    	return updateAt;
    }
	public void setUpdateAt( Date updateAt ) {
    	this.updateAt = updateAt;
    }
	
	public JSONObject toJson(){
		JSONObject jsonObject = new JSONObject();
		jsonObject.put("clubName", getName());
		jsonObject.put("clubUrl", getClubUrl());
		jsonObject.put("provinceId", getProvinceId());
		jsonObject.put("provinceName", getProvinceName());
		jsonObject.put("cityId", getCityId());
		jsonObject.put("cityName", getCityName());
		jsonObject.put("brandId", getBrandId());
		jsonObject.put("brandName", getBrandName());
		jsonObject.put("seriesId", getSeriesId());
		jsonObject.put("seriesName", getSeriesName());
		jsonObject.put("introduce", getIntroduce());
		jsonObject.put("themeId", getThemeId());
		jsonObject.put("appBanner", getAppBanner());
		jsonObject.put("typeId", getTypeId());
		jsonObject.put("qqGroup", getQqGroup());
		return jsonObject;
	}
	
	public JSONObject toJsonEncodeHTML(){
		JSONObject jsonObject = toJson();
		jsonObject.put("introduce", EncodeUtils.encodeForHTMLFilterNull(getIntroduce()));
		return jsonObject;
	}
	
}
